/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wypozyczalnia;

import commons.AbstractDAO;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import magazyn.PrzegladajAutoraData;

/**
 *
 * @author Adrian
 */
public class WyszukajWplatDAO extends AbstractDAO {

    public WyszukajWplatDAO() {
        super();
    }

    public ArrayList<WplataData> getListaWplat() {
        ArrayList<WplataData> list = new ArrayList<WplataData>();


        try {
            query = "SELECT data_wplaty, kwota, ident_biblioteczny FROM wplaty";
            prepStmt = conn.prepareStatement(query);
            rs = prepStmt.executeQuery();

            while (rs.next()) {
                WplataData data = new WplataData();
                data.setData(rs.getString(1));
                data.setKwota(rs.getString(2));
                data.setId(rs.getString(3));
                list.add(data);
            }
            return list;

        } catch (SQLException ex) {
            Logger.getLogger(WyszukajWplatDAO.class.getName()).log(Level.SEVERE, null, ex);
        }

        return null;
    }
}
